// App.tsx
// 导入路由
import React from 'react'
import {
  BrowserRouter as Router,
  Redirect,
  Route,
  Switch
} from 'react-router-dom'

// 导入页面组件
import Login from '@/pages/Login/Login'
import Layout from '@/pages/Layout/Layout'
import ProfileEdit from './pages/Profile/Edit/index'
// 配置路由规则
function App () {
  return (
    <Router>
      <div className="app">
        <Switch>
          <Route exact path="/" render={() => <Redirect to="/home" />} />
          <Route path="/home">
            <Layout />
          </Route>
          <Route path="/login">
            <Login />
          </Route>
          <Route path="/profile/edit">
            <ProfileEdit />
          </Route>
        </Switch>
      </div>
    </Router>
  )
}

export default App
